import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';
import { TabsPage } from '../tabs/tabs';
import { LoginPage } from '../login/login';
import { AuthPage } from '../auth/auth';
// import { Storage } from "@ionic/storage";
/**
 * Generated class for the LoginPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

// @IonicPage()
@Component({
  selector: 'page-majia',
  templateUrl: 'majia.html',
})
export class MajiaPage {
  constructor(
              public navCtrl: NavController,
              public navParams: NavParams
              ) {
  }
  naqian(){
    if (window.localStorage.getItem('phoneNum')) {
      if (Number(window.localStorage.getItem('realNameNeed')) === 1 && Number(window.localStorage.getItem('realNameVerify')) === 0) {
        this.navCtrl.setRoot(AuthPage);
      } else {
        this.navCtrl.setRoot(TabsPage);
      }
    } else {
      this.navCtrl.setRoot(LoginPage);
    }
  }
  ionViewDidLoad() {
    // console.log('ionViewDidLoad LoginPage');
  }
}
